<div id="user_credit_modal" class="modal fade">
  <div class="modal-dialog" >
    <div class="modal-content">
    	<div class="modal-header">
          <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
          <h4 class="modal-title">用户积分</h4>
      </div>
      <div class="modal-body">
				<div class="row">
					<form id="user_credit_form" action='{:U("Admin/User/updateUserCredit")}' method="post">
					<div class="form-group">
						<div class="col-sm-12">
							<div class="col-sm-1"></div>
							<div class="col-sm-3" style="padding-left:15px;padding-top:5px">
								<label for="type" class="control-label">修改类型：</label>
							</div>
							<div class="col-sm-6">
								<select class="form-control" id="type" name="type">
									<option value="0">减少</option>
									<option value="1">增加</option>
								</select>
							</div>
						</div>
				  	<div class="col-sm-12">
				  		<br>
				  		<div class="col-sm-1"></div>
					    <div class="col-sm-3" style="padding-left:15px;padding-top:5px">
								<label for="change_credit" class="control-label">修改积分：</label>
							</div>
							<div class="col-sm-6">
								<input id="change_credit" name="change_credit" class="form-control"></input>
							</div>
						</div>
						<div class="col-sm-12">
				  		<br>
				  		<div class="col-sm-1"></div>
					    <div class="col-sm-3" style="padding-left:15px;padding-top:5px">
								<label for="reason" class="control-label">修改原因：</label>
							</div>
							<div class="col-sm-6">
								<textarea id="reason" name="reason" class="form-control"></textarea>
							</div>
						</div>
					</div>
					</form>
				</div>
			</div>
			<div class="modal-footer">
        <button class="btn btn-primary" onclick="submit()">确认</button>
        <button class="btn btn-defalt" data-dismiss="modal">关闭</button>
    	</div>
		</div>
	</div>
</div>
<script>
$('#user_credit_modal').on("hidden.bs.modal",function(e){
    $("input[name='change_credit']").attr('value', '');
    $("input[name='reason']").html("");
}); 

function submit(){

  $('#user_credit_form').ajaxSubmit({
  		data: {
        'user_id': user_id
      },
      success:function(data){
      		//console.log(data);
          $('#user_credit_modal').modal('hide');
          location.reload();
      }
  });
}
	
</script>